<template>
	<view class="content">
		<view class="cell_content app_content_color">
			<image class="cell_avatar app_background_color" mode="aspectFill" :src="user.icon"></image>
			<view class="cell_info_content">
				<view class="cell_info_username_text app_title_color">{{user.name}}</view>
				<view class="cell_info_user_title_content">
					<view class="cell_info_user_title app_background_color app_title_color">{{user.userTitle}}</view>
					<view class="cell_info_content"></view>
				</view>
			</view>
			<view class="msm_button_content" @tap="msmButtonTap">
				<view>私信</view>
			</view>
		</view>
		<view class="cell_content app_content_color" @tap="cellTap" data-type="topic">
			<view class="cell_info_content">
				<view class="cell_info_cell_title_text app_title_color">Ta发表的</view>
				<view class="cell_info_cell_subtitle_text app_subtitle_color">不管是不是水贴，反正没事写了点啥</view>
			</view>
			<image class="cell_arrow_icon" mode="aspectFit" src="../../static/arrow_icon.png"></image>
		</view>
		<view class="cell_content app_content_color"  @tap="cellTap" data-type="favorite">
			<view class="cell_info_content">
				<view class="cell_info_cell_title_text app_title_color">Ta收藏的</view>
				<view class="cell_info_cell_subtitle_text app_subtitle_color">这篇帖子本人喜欢，不许反驳</view>
			</view>
			<image class="cell_arrow_icon" mode="aspectFit" src="../../static/arrow_icon.png"></image>
		</view>
		<view class="cell_content app_content_color"  @tap="cellTap" data-type="reply">
			<view class="cell_info_content">
				<view class="cell_info_cell_title_text app_title_color">Ta回复的</view>
				<view class="cell_info_cell_subtitle_text app_subtitle_color">不管是不是在灌水，反正回复了点啥</view>
			</view>
			<image class="cell_arrow_icon" mode="aspectFit" src="../../static/arrow_icon.png"></image>
		</view>
	</view>
</template>

<script>
	import http from "../../utils/http.js"
	export default {
		data() {
			return {
				user:{},
				uid:""
			}
		},
		onLoad(options){
			this.uid = options.uid;
			var that = this;
			http.request("user/userinfo",{userId:this.uid},{
				success: function(data) {
					that.user = data;
				},
				fail: function() {
					uni.showToast({
						title:"获取用户信息失败",
						icon:"none"
					})
				}
			})
		},
		methods: {
			cellTap(e){
				var type = e.currentTarget.dataset.type;
				uni.navigateTo({
					url:"../user-post-list/user-post-list?type="+type+"&uid="+this.uid
				})
			},
			msmButtonTap(){
				uni.navigateTo({
					url:"../message-detail/message-detail?fromUid="+this.uid
				})
			}
		}
	}
</script>

<style lang="scss">
	.content{
		display: flex;
		width: 100%;
		flex-direction: column;
	}
	.cell_content{
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-bottom: 1upx;
		padding-top: 30upx;
		padding-bottom: 30upx;
		padding-left: 20upx;
	}
	.cell_avatar{
		width: 100upx;
		height: 100upx;
		margin-left: 30upx;
		margin-top: 50upx;
		margin-bottom: 30upx;
		border-radius: 8upx;
	}
	.cell_info_content{
		display: flex;
		flex-direction: column;
		margin-left: 20upx;
		flex-grow: 1;
	}
	.cell_info_username_text{
		font-size: 30upx;
		margin-top: 20upx;
	}
	
	.cell_info_user_title_content{
		display: flex;
		flex-direction: row;
	}
	
	.cell_info_user_title {
		display: flex;
		border-radius: 4upx;
		height: 30upx;
		padding-left: 10upx;
		padding-right: 10upx;
		align-items: center;
		justify-content: center;
		font-size: 20upx;
		margin-top: 20upx;
	}
	.msm_button_content{
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: $uni-global-green-color;
		color: #fff;
		font-size: 30upx;
		height: 60upx;
		border-radius: 6upx;
		margin-right: 30upx;
		padding-left: 30upx;
		padding-right: 30upx;
		margin-top: 50upx;
	}
	.cell_icon{
		width: 60upx;
		height: 60upx;
		margin-left: 30upx;
		margin-top: 50upx;
		margin-bottom: 50upx;
	}
	.cell_info_cell_title_text{
		font-size: 30upx;
	}
	.cell_info_cell_subtitle_text{
		font-size: 20upx;
		margin-top: 10upx;
	}
	.cell_arrow_icon {
		margin-right: 30upx;
		margin-left: 20upx;
		width: 30upx;
		height: 30upx;
	}

</style>
